package com.feng.Controller;

import com.feng.domain.ResponseResult;
import com.feng.service.UploadService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * 文件上传
 */
@RestController
public class UploadController {
    @Autowired
    private UploadService uploadService;
    @PostMapping("/uploads")
    public ResponseResult uploadImg(MultipartFile img){
        return uploadService.uploadImg(img);
    }
    //改为用阿里云进行上传头像
    @PostMapping("/upload")
    public ResponseResult uploadImgs(MultipartFile img){
        return uploadService.uploadImgs(img);
    }

}
